package cn.th.controller;


import cn.th.common.R;
import cn.th.entity.UserGift;
import cn.th.entity.UserTask;
import cn.th.service.IUserGiftService;
import cn.th.service.IUserTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户-任务-联系表 前端控制器
 * </p>
 *
 * @author cn.th
 * @since 2024-03-30
 */
@Slf4j
@RestController
@RequestMapping("/userTask")
public class UserTaskController {

    @Autowired
    private IUserTaskService userTaskService;

    /**
     * 新增用户所参加的任务
     * @param userTask
     * @return
     */
    @PostMapping
    public R<?> save(@RequestBody UserTask userTask) {
        log.info("userTask:{}", userTask);
        userTaskService.save(userTask);
        return R.success(userTask,"用户新增任务成功");
    }
}

